from django import forms

from .models import userinfo,asset
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User


# 定义登录时表单验证
class LoginForm(forms.Form):
    username = forms.CharField(required=True)
    password = forms.CharField(required=True)


# 定义用户修改密码时表单验证
class UserPwdModifyForm(forms.Form):
    usernum1 = forms.CharField(required=True)
    pwd1 = forms.CharField(required=True)
    pwd2 = forms.CharField(required=True)

# 定义资产表单验证
class assetForm(forms.ModelForm):
    class Meta:
        model = asset
        fields = ['Finish', 'Source', 'Document_No', 'Order_No', 'Requisition_date', 'Materials', 'Department', 'Requisitioner', 'Requisition_Num',
                  'Requisition_purpose','Order_Time','Purchaser','Reason','Supplier','Arrival_time1','Arrival_time2','Actual_time1','Actual_Num1',
                  'Actual_time2','Actual_Num2','Actual_time3','Actual_Num3','Unarrival_Num','Overdue','Overdue_time','Remarks']